X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/097781e6ad3f7bb1c13c16ff7b6bb7219764fb29..b587e9d8e0cc5eb1edf972fd3b644704441e5289:/Super%20Polarity/TitleScreen.cs?ds=sidebyside diff --git a/Super Polarity/TitleScreen.cs b/Super Polarity/TitleScreen.cs index 5b33218..a953f27 100644 --- a/Super Polarity/TitleScreen.cs +++ b/Super Polarity/TitleScreen.cs @@ -2,11 +2,49 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; namespace SuperPolarity { class TitleScreen : Screen { + protected Texture2D TitleImage; + public TitleScreen(SuperPolarity newGame) : base(newGame) {} + + public override void LoadContent() + { + base.LoadContent(); + TitleImage = Game.Content.Load("Graphics\\polaritydemotitle"); + InputController.Bind("pause", HandleStart); + } + + public void HandleStart(float value) + { + if (!Active) { return; } + Game.Player.Reset(); + var gameScreen = new GameScreen(Game); + gameScreen.Initialize(); + ScreenManager.Push(gameScreen); + } + + public override void CleanUp() + { + base.CleanUp(); + TitleImage = null; + } + + public override void Draw(SpriteBatch spriteBatch) + { + base.Draw(spriteBatch); + spriteBatch.Draw(TitleImage, new Vector2(0, 0), Color.White); + } + + public override void Update(GameTime gameTime) + { + base.Update(gameTime); + InputController.UpdateInput(false); + } } }